{% extends 'base.html' %}
{% load static i18n %}
{% block title %}Home{% endblock %}
{% block content %}
<div class="row">
    <div class="col-md-8">
    {% if not user.is_authenticated and page_obj.number < 2 %}
    <div class="jumbotron noauth">
        <h1>Observing Portal</h1>
        <p>This is your access point to Las Cumbres Observatory's global network of telescopes. Registered users can:</p>
        <ul class="list-unstyled">
            <li><i class="fa fa-group fa-3x fa-pull-left" aria-hidden="true"></i>
                <span>Submit proposals and manage the membership of their research teams.</span>
            </li>
            <li><i class="fa fa-wpexplorer fa-3x fa-pull-left" aria-hidden="true"></i>
                <span>Compose, save, and submit observing requests.</span>
            </li>
            <li><i class="fa fa-cloud-download fa-3x fa-pull-left" aria-hidden="true"></i>
                <span>Check the status of submitted requests, and download data from completed observations.</span>
            </li>
        </ul>
        <a href="{% url 'registration_register' %}" class="btn btn-lg btn-success col-md-5">Register an Account</a>
        <a href="{% url 'auth_login' %}" class="btn btn-lg btn-default col-md-5 col-md-offset-2">Login</a>
        <br/>
    </div>
    {% endif %}
    {% block request_list %}
    {% endblock %}
    </div>
    <div class="col-md-4">
        <div class="row">
            <div class="col-md-12">
                <h3>Quick Navigation</h3>
                <ul class="list-unstyled sidebar-nav">
                <li><a href="{% url 'userrequests:create' %}"><i class="fa fa-wpexplorer fa-2x fa-fw"></i> Submit Observation</a></li>
                <li><a href="{% url 'proposals:list' %}?active=True"><i class="fa fa-group fa-2x fa-fw"></i> Manage Proposals</a></li>
                </ul>
            </div>
        </div>
        <div class="row">
            <div class="col-md-12">
                <h3>Need more information?</h3>
                Check out the  <a href="{% url 'help' %}">help page.</a>
            </div>
        </div>
        <h3>Telescope availability history</h3>
        <p>This chart shows the percent of operational science time for each telescope over the last 4 days. View the <a href="https://lco.global/observatory/status/">detailed operational status.</a></p>
        <div id="telescope_availability_chart"></div>
        {% if user.is_authenticated %}
        <div class="row">
            <div class="col-md-12">
                <h3>Active Proposals</h3>
                {% for proposal in user.profile.current_proposals %}
                <p><a href="{% url 'proposals:detail' pk=proposal.id %}">{{ proposal }}</a>
                <br/>
                <small>{{ proposal.title }}</small>
                </p>
                {% empty %}
                <p>{% trans 'You have no current proposals' %}</p>
                <p>
                    <a href="{% url 'sciapplications:index' %}">
                    {% trans 'Submit a proposal' %}
                    </a>
                </p>
                {% endfor %}
            </div>
        </div>
        {% endif %}
    </div>
</div>
{% endblock %}
{% block extra_javascript %}
<script type="text/javascript" src="{% static '/bundles/telescope_availability.js' %}"></script>
{% endblock %}
